import { Component, Input } from '@angular/core';

import { ComponentBase } from '../share';

@Component({
    selector: 'ng-custom-component',
    template:  `
        <input [(ngModel)]="id">
        <span>{{id}}</span>
       `
})
export class CustomComponent extends ComponentBase {
    _id: number;
    @Input() get id(): number {
        return this._id;
    }

    set id(value: number) {
        this.internalConsoleLog(` value ${value}`);
        this._id = value;
    }
}

@Component({
    selector: 'ng-dynamic-component',
    template: `
    <div  *ngIf="isCreate">
        <div  *dynamicComponent="template; context:context;"></div>
    </div>
    `
})
export class MyNgDynamicComponent extends ComponentBase {
    @Input() template: string;
    @Input() context: any;
    @Input() isCreate: boolean;


}
